package com.itfenghuang.day13_练习;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class 客户端 {
    public static void main(String[] args) throws IOException {
        Socket sk = new Socket("127.0.0.1",12345);
        OutputStream os = sk.getOutputStream();
        os.write("小东西".getBytes());
        InputStream is = sk.getInputStream();
        byte[] xx=new byte[1024];
        int i = is.read(xx);
        System.out.println(new String(xx,0,i));
        sk.close();

    }
}
